/*
 * @Copyright: 2025 Copyright (C) AMCAX, All rights reserved.
 * @Author: Zhang
 * @Date: 2025/7/24 19:39
 * @LastEditTime: 2025/7/24 19:39
 * @LastEditors: Zhang
 * @Description:
 */

import {
  cmdCloudClean,
  cmdCloudMesh,
  cmdCloudNormal,
  cmdCloudSimplify,
  cmdMeshClean,
  cmdMeshSimplify,
} from '@/commands/modelClean';
import { CmdButton } from '@/components/CmdBar/CmdButtons';
import { ICommandLayout, TCmdGroup } from '@/components/types';
import { FeatureManager } from '@amcax/base';
import { Flex } from 'antd';

const EditLayout = () => {
  return (
    <Flex>
      {FeatureManager.isFeatureEnabled('cmd-cloud-clean') && (
        <CmdButton cmd={cmdCloudClean} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-cloud-simplify') && (
        <CmdButton cmd={cmdCloudSimplify} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-cloud-normal') && (
        <CmdButton cmd={cmdCloudNormal} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-cloud-mesh') && (
        <CmdButton cmd={cmdCloudMesh} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-mesh-clean') && (
        <CmdButton cmd={cmdMeshClean} />
      )}
      {FeatureManager.isFeatureEnabled('cmd-mesh-simplify') && (
        <CmdButton cmd={cmdMeshSimplify} />
      )}
    </Flex>
  );
};

const cmdGroups: TCmdGroup[] = [
  {
    id: 'draw',
    label: '编辑',
    layout: <EditLayout />,
    visible: true,
  },
];

export const modelClean: ICommandLayout = {
  id: 'modelClean',
  label: '模型清理',
  cmds: cmdGroups,
};
